from system_app.models import user


## 根据 opendid 获取用户信息，
def getUserInfo(openid):

    user_info = user.objects.filter(openid=openid).first()

    return user_info


## 根据 uuid 获取用户信息
def getUserInfoByUuid(uuid):

    user_info = user.objects.filter(uuid=uuid).first()
    return user_info


## 插入用户信息
def addUser(data):
    result_info = user.objects.create(**data)
    return result_info


## 更新用户信息
def updateUser(uuid, data):
    user_info = user.objects.filter(uuid=uuid)
    res = user_info.update(**data)
    return res
